<?php

namespace app\api\controller;

use app\common\controller\Api;
use app\common\model\Commission;
use think\Db;

/**
 * 首页接口
 */
class Index extends Api
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];

    /**
     * 首页
     *
     */
    public function index()
    {
        $this->success('请求成功');
    }
    
    public function notice() {
    	$rows = Db::name('notice')->select();
    	$this->success('查询成功', $rows);
    }
	
	public function detail() {
		$rows = Db::name('notice')->find($this->request->post('id'));
		if($rows) {
			$this->success('查询成功', $rows);
		}else{
			$this->error('公告不存在');
		}
	}
    
    public function setting() {
        $row = Db::name('setting')->find();
	    $row['beian'] = config('site.beian');
        $this->success('查询成功', $row);
    }
    
    public function test(){
    	$orderId = 55;
    	$model = new \app\common\model\Order();
    	$res = $model->paySuccess($orderId);
    	echo $res;
    }
}
